<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">
    <h1>{{msg}}</h1>
    <!-- 数组 -->
    <ul>
      <li v-for="item of studs">{{item.name}}---{{item.age}}</li>
    </ul>
    <!-- 对象 -->
    <ul>
      <li v-for="item in obj">{{item}}</li>
    </ul>
    <!-- 字符串 -->
    <ul>
      <li v-for="item in msg">{{item}}</li>
    </ul>
    <!-- 数字 -->
    <!-- v-for遍历数字,其实就是遍历数字对应的次数 item从1开始到num -->
    <ul>
      <li v-for="item of num">{{item}}</li>
    </ul>
  </div>
  <script>
    Vue.config.productionTip = false;
    const vm = new Vue({
      el: "#app",
      data() {
        return {
          msg: "hello vue!",
          studs: [{
              id: "001",
              name: "黑大帅",
              age: 8,
            },
            {
              id: "002",
              name: "大卤蛋",
              age: 6,
            },
            {
              id: "003",
              name: "懒洋洋",
              age: 3,
            },
          ],
          obj: {
            name: "黑大帅",
            NB: "真牛逼",
          },
          num: 666,
        }
      },
      methods: {}
    })
  </script>
</body>

</html>